package day11_special_file_log_code.com.itheima.d1_properties;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

public class Demo1_Properties {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();

        System.out.println(properties);
        properties.load(new FileInputStream("java_02_Pro/src/main/java/day11_special_file_log_code/com/itheima/d1_properties/users.properties"));

        System.out.println("properties = " + properties);

        System.out.println("properties.getProperty(\"赵敏\") = " + properties.getProperty("赵敏"));
        Set<String> keys = properties.stringPropertyNames();
        for (String key : keys) {
            String value = properties.getProperty(key);
            System.out.println("(key + \"---\" + value) = " + (key + "---" + value));
        }
        properties.forEach((k,v) -> {
            System.out.println(k + "---" + v);
        });
    }
}
